<?php
  include_once 'Conexao.php';

  if (isset($_POST["usuario"]) && isset($_POST["senha"])) {
        $bd= new Conexao();
        $bd->conectar();
        echo "vai no banco";
        $result = $bd->login($_POST["usuario"], $_POST["senha"]);      
        if(@mysql_fetch_row($result)){
            session_start();
            $_SESSION["Login"] = session_id();
            echo session_id();
            header("Location: AreaAdministrativa.php?secao=".$_SESSION["Login"]);
      }else{
           session_start();
           $_SESSION ["Login"] = "NO";
           echo "SHIT";
           header("Location: login.php");
      }
  }

?>
